package cn.hiapi.shopkeeper.service.activity;

import cn.hiapi.basic.ResUtils;
import cn.hiapi.basic.jpa.pageable.QueryWrapper;
import cn.hiapi.basic.service.AbsBasicService;
import cn.hiapi.shopkeeper.entity.activity.ActivitySolitaireItem;
import cn.hiapi.shopkeeper.jpa.activity.ActivitySolitaireItemJpa;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author AdinZ
 * @date 2023/1/3 22:36
 */
@Service
public class ActivitySolitaireItemService extends AbsBasicService<ActivitySolitaireItemJpa, ActivitySolitaireItem, Long> {
    @Transactional
    public int deleteByAid(long aid) {
        return ResUtils.getDefault(this.repository.deleteByAid(aid));
    }

    public List<ActivitySolitaireItem> listByAid(long aid) {
        return this.findList(new QueryWrapper().eq("aid", aid));
    }
}
